<%@ Page Language="VB" MasterPageFile="~/masterpages/_MaestraRegistro.master" AutoEventWireup="false"
    CodeFile="buscar.aspx.vb" Inherits="Registro_buscar" Title="Busqueda de animal" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link media="screen" rel="stylesheet" href="../Estilos/colorbox.css" />

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>

    <script src="../jscripts/colorbox/jquery.colorbox.js" type="text/javascript"></script>

    <link href="../Estilos/formulario.css" rel="Stylesheet" type="text/css" />

    <script type="text/javascript">
        $(document).ready(function() {
            //Examples of how to assign the ColorBox event to elements
            $(".detalles").colorbox({ width: "900px", height: "610px", iframe: true });
            $(".nuevo").colorbox({ width: "780px", height: "450px", iframe: true, overlayClose: false, escKey: false, arrowKey: false });
        });
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </ajaxToolkit:ToolkitScriptManager>
    <center>
        <table>
            <tr>
                <td class="FormHeaderTD">
                    Nuevo animal
                </td>
                <td class="DataTD" align="center" width="30px">
                    <asp:HyperLink ID="HyperLink2" runat="server" CssClass="nuevo" ImageUrl="~/images/nuevo1.png"
                        NavigateUrl="~/Registro/NuevoAnimal.aspx" ToolTip="Registro de nuevo animal">Agregar</asp:HyperLink>
                </td>
            </tr>
        </table>
    </center>
    <asp:SqlDataSource ID="sqlGeneral" runat="server" ConnectionString="<%$ ConnectionStrings:GanaderiaConnectionString %>">
    </asp:SqlDataSource>
    <div class="editar">
        <center>
            <table>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td class="DataTD" colspan="2">
                        <strong>No Registros</strong>
                    </td>
                    <td class="FormHeader">
                        <asp:Label ID="lblRegistros" runat="server" Text="200"></asp:Label>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td align="center">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td colspan="5">
                        <asp:Panel ID="pnFiltro" runat="server">
                            <asp:Label ID="lblFiltroNombre" runat="server" Text="Toros Javier Garfias" ToolTip="Nombre del filtro"></asp:Label>
                            &nbsp;&nbsp;
                            <asp:HyperLink ID="lkEdicionFiltro" runat="server" ImageUrl="~/images/editar.gif"
                                ToolTip="Edicion del filtro">HyperLink</asp:HyperLink></asp:Panel>
                    </td>
                    <td align="center">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="6" class="FormHeaderTD">
                        BUSCAR
                    </td>
                    <td class="FormHeaderTD">
                        Filtro
                    </td>
                    <td class="FormHeaderTD">
                        Liberar
                    </td>
                </tr>
                <tr>
                    <td class="DataTD">
                        &nbsp;<strong>Animal:</strong>&nbsp;
                    </td>
                    <td class="DataTD">
                        <asp:TextBox ID="txtAnimal" runat="server" MaxLength="8" Width="80px" CssClass="text Upper"
                            AutoPostBack="True" TabIndex="1"></asp:TextBox>
                        <ajaxToolkit:TextBoxWatermarkExtender ID="txtAnimal_TextBoxWatermarkExtender" runat="server"
                            Enabled="True" TargetControlID="txtAnimal" WatermarkText="Ej: 88C" WatermarkCssClass="watermarked">
                        </ajaxToolkit:TextBoxWatermarkExtender>
                    </td>
                    <td class="DataTD">
                        &nbsp;<strong>Padre</strong>&nbsp;
                    </td>
                    <td class="DataTD">
                        <asp:TextBox ID="txtPadre" runat="server" MaxLength="8" Width="80px" CssClass="text Upper"
                            AutoPostBack="True"></asp:TextBox>
                        <ajaxToolkit:TextBoxWatermarkExtender ID="waterTxtPadre" runat="server" Enabled="True"
                            TargetControlID="txtPadre" WatermarkText="Ej: 232D1999" WatermarkCssClass="watermarked">
                        </ajaxToolkit:TextBoxWatermarkExtender>
                    </td>
                    <td class="DataTD">
                        &nbsp;<strong>Madre</strong>&nbsp;
                    </td>
                    <td class="DataTD">
                        <asp:TextBox ID="txtMadre" runat="server" MaxLength="8" Width="80px" CssClass="text Upper"
                            AutoPostBack="True"></asp:TextBox>
                        <ajaxToolkit:TextBoxWatermarkExtender ID="waterTxtMadre" runat="server" Enabled="True"
                            TargetControlID="txtMadre" WatermarkText="Ej: 300D1999" WatermarkCssClass="watermarked">
                        </ajaxToolkit:TextBoxWatermarkExtender>
                    </td>
                    <td class="DataTD" align="center">
                        <asp:CheckBox runat="server" ID="chkFiltro" AutoPostBack="true" />
                    </td>
                    <td class="DataTD" align="center">
                        
                        <asp:ImageButton ID="btnLiberar" runat="server" ImageUrl="~/images/mover.png" />
                        
                    </td>
                </tr>
            </table>
            <br />
            <asp:Label ID="lblSQL" runat="server" Text="Label"></asp:Label>
            <br />
            <br />
        </center>
        <asp:GridView ID="grvCrias" runat="server" AllowSorting="True" AutoGenerateColumns="False"
            HorizontalAlign="Center" CellPadding="4" ForeColor="#333333" GridLines="None"
            PageSize="100" DataKeyNames="AnimalId" DataSourceID="sqlGeneral" AllowPaging="True">
            <PagerSettings Position="TopAndBottom" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="sexo" HeaderText="SX" SortExpression="sexo" />
                <asp:TemplateField HeaderText="Animal" SortExpression="numero">
                    <ItemTemplate>
                        <asp:HyperLink ID="hlAnimal" runat="server" ToolTip="Detalles del animal" NavigateUrl='<%# Eval("AnimalId", "~/Registro/general.aspx?animal={0}&opt=1&modulo=1")%>'
                            Text='<%# Eval("numero") & Eval("letra") & Eval("ano") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="nombre" HeaderText="Nombre" SortExpression="nombre" />
                <asp:BoundField DataField="hierro" HeaderText="Hierro" SortExpression="hierro" />
                <asp:BoundField DataField="ubicacion" HeaderText="Ubica" SortExpression="ubicacion" />
                <asp:BoundField DataField="pelaje1" HeaderText="Pelaje" SortExpression="pelaje1" />
                <asp:BoundField DataField="porcien_cs" HeaderText="%CS" SortExpression="porcien_cs" />
                <asp:TemplateField HeaderText="Padre" SortExpression="no_padre">
                    <ItemTemplate>
                        <asp:HyperLink ID="hlPadre" runat="server" ToolTip="Detalles del animal" NavigateUrl='<%# Eval("id_padre", "~/Registro/detalles.aspx?animal={0}")%>'
                            CssClass="detalles" Text='<%# Eval("no_padre") & Eval("ltra_padre") & Eval("ano_padre") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Madre" SortExpression="no_madre">
                    <ItemTemplate>
                        <asp:HyperLink ID="hlMadre" runat="server" ToolTip="Detalles del animal" NavigateUrl='<%# Eval("id_madre", "~/Registro/detalles.aspx?animal={0}")%>'
                            CssClass="detalles" Text='<%# Eval("no_madre") & Eval("ltra_madre") & Eval("ano_madre") %>'></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="abuelo_mat" HeaderText="Abuelo" SortExpression="abuelo_mat" />
                <asp:BoundField DataField="tienta_ac" HeaderText="TC" SortExpression="tienta_ac" />
                <asp:BoundField DataField="tienta_ap" HeaderText="TP" SortExpression="tienta_ap" />
                <asp:BoundField DataField="lidia_ac" HeaderText="LC" SortExpression="lidia_ac" />
                <asp:BoundField DataField="lidia_ap" HeaderText="LP" SortExpression="lidia_ap" />
                <asp:BoundField DataField="estatus" HeaderText="ST" SortExpression="estatus" />
                <asp:BoundField DataField="fechanac" HeaderText="Nacimiento" SortExpression="fechanac"
                    DataFormatString="{0:d}" />
                <asp:BoundField DataField="fechabaja" HeaderText="Baja" SortExpression="fechabaja"
                    DataFormatString="{0:d}" />
                <asp:BoundField DataField="hijos" HeaderText="Hijos" SortExpression="hijos" />
                <asp:BoundField DataField="hijas" HeaderText="Hijas" SortExpression="hijas" />
                <asp:BoundField DataField="tienta_fecha" HeaderText="Tienta" SortExpression="tienta_fecha"
                    DataFormatString="{0:d}" />
                <asp:BoundField DataField="tienta_torero" HeaderText="Torero" SortExpression="tienta_torero" />
                <asp:CheckBoxField DataField="photo" HeaderText="Foto" SortExpression="photo" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                <div class="error">
                    No existen animales con los criterios dados, intente modificar los parametros de
                    la consulta.
                </div>
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
    </div>
</asp:Content>
